// src/personal/entities/personal-list.entity.ts
import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';

@Entity()
export class PersonalList {
  @PrimaryGeneratedColumn()
  id: number;

  @Column() // 标题
  title: string;

  @Column({ default: 'null.png' }) // 图片地址
  imageUrl: string;

  @Column({ nullable: true }) // 文本内容
  content: string;

  @Column({ default: 1 })
  sort_order: number; // 排序权重（数字越大越靠前）

  @Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
  createdAt: Date;

  @Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP', onUpdate: 'CURRENT_TIMESTAMP' })
  updatedAt: Date;
}